import request from '@/utils/request'

// 获取用户列表
export const getUsers = (params) => {
  return request({
    url: `/user`,
    method: 'get',
    params
  })
}

// 获取用户
export const getUser = (id) => {
  return request({
    url: `/user/${id}`,
    method: 'get'
  })
}

// 创建用户
export const createUser = (data) => {
  return request({
    url: `/user`,
    method: 'post',
    data
  })
}

// 修改用户
export const updateUser = (id, data) => {
  return request({
    url: `/user/${id}`,
    method: 'put',
    data
  })
}

// 删除用户
export const removeUser = (id) => {
  return request({
    url: `/user/${id}`,
    method: 'delete',
  })
}

